package com.ruoyi.back.controller.v3

import com.ruoyi.app.common.Data
import com.ruoyi.app.common.PageData
import com.ruoyi.app.common.pageInfo
import com.ruoyi.back.domain.v3.ExperienceRecord
import com.ruoyi.back.domain.v3.dto.UserExperienceRecordSearchDto
import com.ruoyi.back.service.v3.ExperienceRecordService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("/system/userExperienceRecord")
@Api(tags = ["体验模板管理"])
class UserExperienceRecordController {

    @Autowired
    private lateinit var experienceRecordService: ExperienceRecordService


    @ApiOperation("保存体验的相关信息")
    @PostMapping("saveExperienceRecordInfo")
    fun saveExperienceRecordInfo(@RequestBody experienceRecord: ExperienceRecord): Data<Boolean> = experienceRecordService.saveExperienceRecordInfo(experienceRecord)


    @ApiOperation("获取体验模板")
    @GetMapping("getExperienceRecordList")
    fun getExperienceRecordList(userExperienceRecordSearchDto: UserExperienceRecordSearchDto): PageData<ExperienceRecord> =
        experienceRecordService.getExperienceRecordList(userExperienceRecordSearchDto).pageInfo()

    @ApiOperation("移除体验模板")
    @GetMapping("removeExperienceRecord")
    fun removeExperienceRecord(ids: String): Data<Boolean> = experienceRecordService.removeExperienceRecord(ids)
}